/**
 * @file
 * @auth jinguangguo
 * @date 2017/01/19
 */

import CONFIG from './config';

export default {
    /**
     * 格式化创建日期
     * @param createDate
     * @returns {string}
     */
    getDateHtml(createDate) {
        let dateArr = createDate.split(' ');
        return `
            <p class="date">${dateArr[0]}</p>
            <p style="color: #999;">${dateArr[1]}</p>
        `;
    },

    /**
     * 格式化交易类型
     * @param tradeCoinType
     * @returns {*}
     */
    getTradeTypeHtml(tradeCoinType) {
        let tradeCoinTypeHtml;
        let that = this;
        // 类型
        if (tradeCoinType === CONFIG.TRADE_TYPE_BUY.KEY) {
            tradeCoinTypeHtml = `<p class="fn-color-buy">${CONFIG.TRADE_TYPE_BUY[window.app.LANG]}</p>`;
        } else if (tradeCoinType === CONFIG.TRADE_TYPE_SELL.KEY) {
            tradeCoinTypeHtml = `<p class="fn-color-sell">${CONFIG.TRADE_TYPE_SELL[window.app.LANG]}</p>`;
        } else {
            tradeCoinTypeHtml = tradeCoinType;
        }
        return tradeCoinTypeHtml;
    }
}